package com.huiren.ui.configUI;

import java.util.List;
import javax.swing.table.AbstractTableModel;

public class DateTableModel extends AbstractTableModel {
	private static final long serialVersionUID = 1L;
	private List<List<Object>> data = null;// 第一行为表头

	public DateTableModel() {

	}

	public String getColumnName(int c) {
		if (data == null)
			return "";
		return data.get(0).get(c).toString();
	}

	public int getRowCount() {
		if (data == null)
			return 0;
		return data.size() - 1;
	}

	public int getColumnCount() {
		if (data == null)
			return 0;
		return data.get(0).size();
	}

	public Object getValueAt(int rowIndex, int columnIndex) {
		if (data == null)
			return null;
		return data.get(rowIndex + 1).get(columnIndex);
	}

	public List<List<Object>> getData() {
		return data;
	}

	public void setData(List<List<Object>> data) {
		this.data = data;
	}

}
